﻿Imports LRS.BLL
Imports LRS.DTO
Imports System.Collections.Generic

Public Class ReceiveProduct
    Private Class OrderInfo

        Private _SalesOrderNumber As String
        Public Property SalesOrderNumber() As String
            Get
                Return _SalesOrderNumber
            End Get
            Set(ByVal value As String)
                _SalesOrderNumber = value
            End Set
        End Property

        Private _CustomerName As String
        Public Property CustomerName() As String
            Get
                Return _CustomerName
            End Get
            Set(ByVal value As String)
                _CustomerName = value
            End Set
        End Property

        Private _DateOfBill As DateTime
        Public Property DateOfBill() As DateTime
            Get
                Return _DateOfBill
            End Get
            Set(ByVal value As DateTime)
                _DateOfBill = value
            End Set
        End Property

    End Class
    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim orderInfo As List(Of OrderInfo) = New List(Of OrderInfo)
        Dim orders As List(Of eSalesOrder) = bSalesOrder.GetOrdersByNumber(txtSearch.Text)
        For Each order As eSalesOrder In orders
            Dim info As OrderInfo = New OrderInfo()
            info.SalesOrderNumber = order.SalesOrderNumber
            info.CustomerName = bCustomer.GetCustomerByID(order.CustomerID).CustomerNumber
        Next
        gridOrder.DataSource = Nothing
        gridOrder.DataSource = orderInfo
    End Sub
End Class